from enum import Enum


class ErrorCodeEnum(Enum):
    INVALID_TOKEN = {'err_code': 80006, 'msg': 'Token无效'}
    TOKEN_EXPIRED = {'err_code': 80010, 'msg': 'Token已过期'}

    USER_DOES_NOT_EXIST = {'err_code': 80007, 'msg': '用户不存在'}
    USER_DISABLED = {'err_code': 80008, 'msg': '用户被禁用'}
    USER_VIP_EXPIRED = {'err_code': 80009, 'msg': '用户会员已过期'}
    PHONE_NUMBER_REQUIRED = {'err_code': 80011, 'msg': '请填写手机号码'}
    PHONE_NUMBER_ALREADY_BOUND = {'err_code': 80012, 'msg': '手机号码已绑定微信'}
    UNION_ID_UNMATCHED = {'err_code': 80013, 'msg': '系统绑定手机与微信用户不匹配'}

    INVALID_VERIFICATION_CODE = {'err_code': 80020, 'msg': '验证码无效'}
    NETWORK_ERROR = {'err_code': 80030, 'msg': '网络错误'}

    PRODUCT_DOES_NOT_EXIST = {'err_code': 80040, 'msg': '产品不存在'}
    INVALID_ORDER = {'err_code': 80050, 'msg': '订单无效'}

    TRANSFER_CREDIT_SCORE_ERROR = {'err_code': 80060, 'msg': '转让信用分不可大于现有信用分'}


class MessageTypeEnum(Enum):
    NEW_DEVICE = {"message_code": 1, "message_type": "设备上新"}
    PRESERVE_DEVICE = {"message_code": 2, "message_type": "设备维修"}
    APPOINTMENT = {"message_code": 3, "message_type": "预约"}
    CREDIT_SCORE = {"message_code": 4, "message_type": "信用分"}

    def get_message_code(self):
        return self.value["message_code"]


class CreditScoreEnum(Enum):
    BREAK_APPOINTMENT = {"score": -10, "behavior": "爽约"}
    NOT_CLEAN = {"score": -10, "behavior": "未打扫"}
    WASTE_MATERIAL = {"score": -10, "behavior": "耗材使用过多"}
    NORMAL = {"score": -1, "behavior": "正常使用"}
    OVERTIME = {"score": -5, "behavior": "超时"}

    EXPERIMENTAL_RESULTS = {"score": 10, "behavior": "实验成果"}
    COMPETITION_REWARDS = {"score": 10, "behavior": "竞赛奖励"}
    PROCESS_ASSISTANTS = {"score": 5, "behavior": "协助加工"}
    TEACH_ASSISTANT = {"score": 5, "behavior": "助教研教"}

    TRANSFER_SCORE = {"score": 0, "behavior": "转让信用分"}
